package com.zc.demo.dao;

import com.zc.demo.model.BookInfo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;


//@Component
@Repository
public class BookDao {
    public List<BookInfo> mockData(){
        List<BookInfo> books = new ArrayList<>();
        for(int i = 0; i < 15; i++){
            //生成信息
            BookInfo book = new BookInfo();
            book.setBook_id((long) i);
            book.setBook_name("书籍"+i);
            book.setBook_author("作者"+i);
            book.setBook_number(new Random().nextLong(50));
            book.setBook_price(new Random().nextLong(100));
            book.setBook_publish("社会出版社"+i);
            book.setBook_status((long) (i%5==0?0:1));
            books.add(book);
        }
        return books;
    }
}
